package com.ruoyi.recycle.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.ruoyi.recycle.domain.EssayQuestionType;
import com.ruoyi.recycle.mapper.EssayQuestionTypeMapper;
import com.ruoyi.recycle.service.IEssayQuestionTypeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 问答分类Service业务层处理
 *
 * @author Wubk
 * @date 2022-05-22
 */
@Service
public class EssayQuestionTypeServiceImpl extends ServiceImpl<EssayQuestionTypeMapper, EssayQuestionType> implements IEssayQuestionTypeService {
    @Autowired
    private EssayQuestionTypeMapper essayQuestionTypeMapper;

    /**
     * 查询问答分类
     *
     * @param id 问答分类主键
     * @return 问答分类
     */
    @Override
    public EssayQuestionType selectEssayQuestionTypeById(Long id) {
        return essayQuestionTypeMapper.selectEssayQuestionTypeById(id);
    }

    /**
     * 查询问答分类列表
     *
     * @param essayQuestionType 问答分类
     * @return 问答分类
     */
    @Override
    public List<EssayQuestionType> selectEssayQuestionTypeList(EssayQuestionType essayQuestionType) {
        return essayQuestionTypeMapper.selectEssayQuestionTypeList(essayQuestionType);
    }

    /**
     * 新增问答分类
     *
     * @param essayQuestionType 问答分类
     * @return 结果
     */
    @Override
    public int insertEssayQuestionType(EssayQuestionType essayQuestionType) {
        return essayQuestionTypeMapper.insertEssayQuestionType(essayQuestionType);
    }

    /**
     * 修改问答分类
     *
     * @param essayQuestionType 问答分类
     * @return 结果
     */
    @Override
    public int updateEssayQuestionType(EssayQuestionType essayQuestionType) {
        return essayQuestionTypeMapper.updateEssayQuestionType(essayQuestionType);
    }

    /**
     * 批量删除问答分类
     *
     * @param ids 需要删除的问答分类主键
     * @return 结果
     */
    @Override
    public int deleteEssayQuestionTypeByIds(Long[] ids) {
        return essayQuestionTypeMapper.deleteEssayQuestionTypeByIds(ids);
    }

    /**
     * 删除问答分类信息
     *
     * @param id 问答分类主键
     * @return 结果
     */
    @Override
    public int deleteEssayQuestionTypeById(Long id) {
        return essayQuestionTypeMapper.deleteEssayQuestionTypeById(id);
    }
}
